//
// Created by xili on 2024/8/28 17:42.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class Solution {
public:
    vector<bool> camelMatch(vector <string> &queries, string pattern) {
        int n = queries.size();
        vector<bool> res(n, true);
        for (int i = 0; i < n; i++) {
            int p = 0;
            for (auto c: queries[i]) {
                if (p < pattern.size() && pattern[p] == c) {
                    p++;
                } else if (isupper(c)) {
                    res[i] = false;
                    break;
                }
            }
            if (p < pattern.size()) {
                res[i] = false;
            }
        }
        return res;
    }
};